package com.jinghang.scala_base


object _050AbstractApp {

  def main(args: Array[String]): Unit = {


    val student = new Student2()
    println(student.name)
    student.speak
  }

}


/**
  * 类的方法没有实现（只有定义，没有实现）
  */
abstract class Person2 {

  val name:String
  val age:Int

  def speak

}


class Student2 extends Person2 {
  override def speak: Unit = {
    println("speak")
  }

  override val name: String = "aa"
  override val age: Int = 18
}
